// Replication file: Cox & Gonzalez (2021) Fewer but Younger:
// Changes in Turnout after Voluntary Voting and Automatic Registration in Chile 
clear
set more off

// Suffixes employed when naming variables
// V stands for voters
// NV stands for nonvoters
// Comuna/com stands for municipality
// V (sexo = 1) stands for men
// M (sexo = 0) stands for women
// Inscritos stand for registered
// Rango stands for age range
// Tipologia stands for type of municipality
// inscrito_antes_de_ley=="NO" identifies voters that were not previously registered, 
// inscrito_antes_de_ley=="SI" identifies voters that were previously registered



//database of registered people 2006-2009
use inscritos_2006.dta

forval z=2007/2009 {

	sort comuna
	merge comuna using inscritos_`z'
	drop _merge
}

foreach x in 1819 2024 2529 3034 3539 4044 4549 5054 5559 6064 6569 7074 7579 80 {
	// Summing up new enrolments for each year, by age range
	gen sum_v`x'= (v`x'_2006+v`x'_2007+v`x'_2008+v`x'_2009)*0.465212841 // *0.465212841 corrects for new enrollments that correspond for address change among men
	gen sum_m`x'= (m`x'_2006+m`x'_2007+m`x'_2008+m`x'_2009)*0.459363057 // *0.459363057 corrects for new enrollments that correspond for address change among women
	drop v`x'_2006 v`x'_2007 v`x'_2008 v`x'_2009 m`x'_2006 m`x'_2007 m`x'_2008 m`x'_2009
}

sort comuna
save "inscripcion.dta", replace
clear


// main data
use base.dta, clear

// generate voting booth identifiers
gen uno=1
bysort comuna: gen ident_mesa_V=sum(uno) if sexo==1
bysort comuna: gen ident_mesa_M=sum(uno) if sexo==0

// merging with other databases
sort comuna
merge comuna using "inscripcion.dta" // registrations previous period
drop _merge

sort comuna
merge comuna using "tipologia.dta" // municipality typology
drop _merge

sort comuna sexo
merge comuna sexo using "part_2009.dta" // turnout last election
drop _merge


// generating the adjustments for combined change of AR and VV
foreach x in 1819 2024 2529 3034 3539 4044 4549 5054 5559 6064 6569 7074 7579 80 {
replace sum_v`x'=0 if sum_v`x'==.
replace sum_m`x'=0 if sum_m`x'==.
// number registered
bysort comuna: egen inscritos_com_v`x'_com=sum(v_rango`x' + nv_rango`x') if sexo==1
bysort comuna: egen inscritos_com_m`x'_com=sum(v_rango`x' + nv_rango`x') if sexo==0
// potentially could register without reform (previously unregistered)
bysort comuna: egen potenciales_v`x'_com=sum(v_rango`x' + nv_rango`x') if sexo==1 &  inscrito_antes_de_ley=="NO"
bysort comuna: egen potenciales_m`x'_com=sum(v_rango`x' + nv_rango`x') if sexo==0 &  inscrito_antes_de_ley=="NO"

gen sum_m`x'_pc=sum_m`x'/inscritos_com_m`x'_com
gen sum_v`x'_pc=sum_v`x'/inscritos_com_v`x'_com

//generating mins and maxs by typoology
bysort tipologia: egen min_sum_v`x'_pc=min(sum_v`x'_pc)
gen min_sum_v`x'=min_sum_v`x'_pc*inscritos_com_v`x'_com
bysort tipologia: egen max_sum_v`x'_pc=max(sum_v`x'_pc)
gen max_sum_v`x'=min(max_sum_v`x'_pc*inscritos_com_v`x'_com, potenciales_v`x'_com) //new registered cannot be larger than previously unregistered

bysort tipologia: egen min_sum_m`x'_pc=min(sum_m`x'_pc)
gen min_sum_m`x'=min_sum_m`x'_pc*inscritos_com_m`x'_com
bysort tipologia: egen max_sum_m`x'_pc=max(sum_m`x'_pc)
gen max_sum_m`x'=min(max_sum_m`x'_pc*inscritos_com_m`x'_com,potenciales_m`x'_com)
drop min_sum_v`x'_pc min_sum_m`x'_pc max_sum_v`x'_pc max_sum_m`x'_pc 
// ojo ac� creamos muchas variables que luego borramos***

// SD by typology
bysort tipologia: egen sd_sum_v`x'_pc=sd(sum_v`x'_pc)
bysort tipologia: egen sd_sum_m`x'_pc=sd(sum_m`x'_pc)

// adjustment with 1 SD
gen min2_sum_v`x'=max(0,sum_v`x'_pc-sd_sum_v`x'_pc)*inscritos_com_v`x'_com // registration rate cannot be larger than zero
gen max2_sum_v`x'=min((sum_v`x'_pc+sd_sum_v`x'_pc)*inscritos_com_v`x'_com,potenciales_v`x'_com) //new registered cannot be larger than previously unregistered
gen min2_sum_m`x'=max(0,sum_m`x'_pc-sd_sum_m`x'_pc)*inscritos_com_m`x'_com
gen max2_sum_m`x'=min((sum_m`x'_pc+sd_sum_m`x'_pc)*inscritos_com_m`x'_com, potenciales_m`x'_com) 
// adjustment with 2 SD
gen min3_sum_v`x'=max(0,sum_v`x'_pc-2*sd_sum_v`x'_pc)*inscritos_com_v`x'_com
gen max3_sum_v`x'=min((sum_v`x'_pc+2*sd_sum_v`x'_pc)*inscritos_com_v`x'_com,potenciales_v`x'_com) 
gen min3_sum_m`x'=max(0,sum_m`x'_pc-2*sd_sum_m`x'_pc)*inscritos_com_m`x'_com
gen max3_sum_m`x'=min((sum_m`x'_pc+2*sd_sum_m`x'_pc)*inscritos_com_m`x'_com, potenciales_m`x'_com) 
}


// Automatic Registration
// new voters
gen aut_reg=  v_total if  inscrito_antes_de_ley=="NO"
bysort comuna: egen AR_com_v = sum( aut_reg ) if sexo==1 
bysort comuna: egen AR_com_m = sum( aut_reg ) if sexo==0


// Combined change 
gen AR_com_v_aj=AR_com_v - sum_v1819- sum_v80-  sum_v2024- sum_v2529- sum_v3034-  sum_v3539-sum_v4044- sum_v4549-  sum_v5054- sum_v5559-  sum_v6064- sum_v6569-sum_v7074-  sum_v7579 if sexo ==1
gen AR_com_m_aj=AR_com_m - sum_m1819- sum_m80-  sum_m2024- sum_m2529- sum_m3034-  sum_m3539-sum_m4044- sum_m4549-  sum_m5054- sum_m5559-  sum_m6064- sum_m6569-sum_m7074-  sum_m7579 if sexo ==0
gen AR_com_v_aj_min=AR_com_v -  min_sum_v1819- min_sum_v2024- min_sum_v2529-  min_sum_v3034-  min_sum_v3539-  min_sum_v4044- min_sum_v4549-  min_sum_v5054-min_sum_v5559- min_sum_v6064-min_sum_v6569- min_sum_v7074- min_sum_v7579- min_sum_v80 if sexo ==1
gen AR_com_m_aj_min=AR_com_m -  min_sum_m1819- min_sum_m2024- min_sum_m2529-  min_sum_m3034-  min_sum_m3539-  min_sum_m4044- min_sum_m4549-  min_sum_m5054-min_sum_m5559- min_sum_m6064-min_sum_m6569- min_sum_m7074- min_sum_m7579- min_sum_m80 if sexo ==0
gen AR_com_v_aj_max=AR_com_v -  max_sum_v1819- max_sum_v2024- max_sum_v2529-  max_sum_v3034-  max_sum_v3539-  max_sum_v4044- max_sum_v4549-  max_sum_v5054-max_sum_v5559- max_sum_v6064-max_sum_v6569- max_sum_v7074- max_sum_v7579- max_sum_v80 if sexo ==1
gen AR_com_m_aj_max=AR_com_m -  max_sum_m1819- max_sum_m2024- max_sum_m2529-  max_sum_m3034-  max_sum_m3539-  max_sum_m4044- max_sum_m4549-  max_sum_m5054-max_sum_m5559- max_sum_m6064-max_sum_m6569- max_sum_m7074- max_sum_m7579- max_sum_m80 if sexo ==0

gen AR_com_v_aj_min2=AR_com_v -  min2_sum_v1819- min2_sum_v2024- min2_sum_v2529-  min2_sum_v3034-  min2_sum_v3539-  min2_sum_v4044- min2_sum_v4549-  min2_sum_v5054-min2_sum_v5559- min2_sum_v6064-min2_sum_v6569- min2_sum_v7074- min2_sum_v7579- min2_sum_v80 if sexo ==1
gen AR_com_m_aj_min2=AR_com_m -  min2_sum_m1819- min2_sum_m2024- min2_sum_m2529-  min2_sum_m3034-  min2_sum_m3539-  min2_sum_m4044- min2_sum_m4549-  min2_sum_m5054-min2_sum_m5559- min2_sum_m6064-min2_sum_m6569- min2_sum_m7074- min2_sum_m7579- min2_sum_m80 if sexo ==0
gen AR_com_v_aj_max2=AR_com_v -  max2_sum_v1819- max2_sum_v2024- max2_sum_v2529-  max2_sum_v3034-  max2_sum_v3539-  max2_sum_v4044- max2_sum_v4549-  max2_sum_v5054-max2_sum_v5559- max2_sum_v6064-max2_sum_v6569- max2_sum_v7074- max2_sum_v7579- max2_sum_v80 if sexo ==1
gen AR_com_m_aj_max2=AR_com_m -  max2_sum_m1819- max2_sum_m2024- max2_sum_m2529-  max2_sum_m3034-  max2_sum_m3539-  max2_sum_m4044- max2_sum_m4549-  max2_sum_m5054-max2_sum_m5559- max2_sum_m6064-max2_sum_m6569- max2_sum_m7074- max2_sum_m7579- max2_sum_m80 if sexo ==0

gen AR_com_v_aj_min3=AR_com_v -  min3_sum_v1819- min3_sum_v2024- min3_sum_v2529-  min3_sum_v3034-  min3_sum_v3539-  min3_sum_v4044- min3_sum_v4549-  min3_sum_v5054-min3_sum_v5559- min3_sum_v6064-min3_sum_v6569- min3_sum_v7074- min3_sum_v7579- min3_sum_v80 if sexo ==1
gen AR_com_m_aj_min3=AR_com_m -  min3_sum_m1819- min3_sum_m2024- min3_sum_m2529-  min3_sum_m3034-  min3_sum_m3539-  min3_sum_m4044- min3_sum_m4549-  min3_sum_m5054-min3_sum_m5559- min3_sum_m6064-min3_sum_m6569- min3_sum_m7074- min3_sum_m7579- min3_sum_m80 if sexo ==0
gen AR_com_v_aj_max3=AR_com_v -  max3_sum_v1819- max3_sum_v2024- max3_sum_v2529-  max3_sum_v3034-  max3_sum_v3539-  max3_sum_v4044- max3_sum_v4549-  max3_sum_v5054-max3_sum_v5559- max3_sum_v6064-max3_sum_v6569- max3_sum_v7074- max3_sum_v7579- max3_sum_v80 if sexo ==1
gen AR_com_m_aj_max3=AR_com_m -  max3_sum_m1819- max3_sum_m2024- max3_sum_m2529-  max3_sum_m3034-  max3_sum_m3539-  max3_sum_m4044- max3_sum_m4549-  max3_sum_m5054-max3_sum_m5559- max3_sum_m6064-max3_sum_m6569- max3_sum_m7074- max3_sum_m7579- max3_sum_m80 if sexo ==0



/// Voluntary voting
// min and max turbout rate by typology
bysort tipologia sexo: egen min_part2009=min(part_com_gen_2009)
bysort tipologia sexo: egen max_part2009=max(part_com_gen_2009)

gen vol_vot_aj= nv_total-(1-part_com_gen_2009)*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"
gen vol_vot_aj_min= nv_total-(1-min_part2009)*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"
gen vol_vot_aj_max= nv_total-(1-max_part2009)*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"

// Adjustments
// SD turnout by typology
bysort tipologia sexo: egen sd_part09=sd(part_com_gen_2009)

// 1 SD
gen vol_vot_aj2_min= nv_total-(1-max(part_com_gen_2009-sd_part09,0))*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"
gen vol_vot_aj2_max= nv_total-(1-min(part_com_gen_2009+sd_part09,1))*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"

// 2 SD
gen vol_vot_aj3_min= nv_total-(1-max(part_com_gen_2009-2*sd_part09,0))*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"
gen vol_vot_aj3_max= nv_total-(1-min(part_com_gen_2009+2*sd_part09,1))*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"



** Table 1 works with another database, so see lines 330


// Table 2 Estimates for total changes after reform, by sex

* Turnout 2013
* Men
total v_total if sexo==1

* Women
total v_total if sexo==0

* Total
total v_total 

* Electoral roll 2013
* Men
total totalpadron if sexo==1

* Women
total totalpadron if sexo==0

* Total
total totalpadron 

* New voters
* Men
total v_total if inscrito_antes_de_ley=="NO" & sexo==1
total AR_com_v_aj AR_com_v_aj_max2 AR_com_v_aj_min2 AR_com_v_aj_max3 AR_com_v_aj_min3 if ident_mesa_V==1

* Women
total v_total if inscrito_antes_de_ley=="NO" & sexo==0
total AR_com_m_aj AR_com_m_aj_max2 AR_com_m_aj_min2 AR_com_m_aj_max3 AR_com_m_aj_min3 if ident_mesa_M==1

* Previously registered nonvoters
* Men
total nv_total if inscrito_antes_de_ley=="SI" & sexo==1

* Women
total nv_total if inscrito_antes_de_ley=="SI"& sexo==0

* Total
total nv_total if inscrito_antes_de_ley=="SI"

* Change attributable to voluntary voting among the registered
* Men
total vol_vot_aj vol_vot_aj2_min vol_vot_aj2_max vol_vot_aj3_min vol_vot_aj3_max  if sexo==1

* Women
total vol_vot_aj vol_vot_aj2_min vol_vot_aj2_max vol_vot_aj3_min vol_vot_aj3_max  if sexo==0



// Table 3 Estimates of the changes after reform with respect to affected populations, by sex (see Excel file "Tables 3 and 4")


// Table A3.1 Bounds for Turnout by Municipality Typology 

// Minimum bound - Men
mean min_part2009 if sexo == 1, over(tipologia)

// Minimum bound - Women
mean min_part2009 if sexo == 0, over(tipologia)

// Maximum bound - Men
mean max_part2009 if sexo == 1, over(tipologia)

// Maximum bound - Women
mean max_part2009 if sexo == 0, over(tipologia)



// Table A3.2  Estimates of changes under more demanding approach, by sex (see Excel file)


* New voters
* Men
total  AR_com_v AR_com_v_aj AR_com_v_aj_max  AR_com_v_aj_min if ident_mesa_V==1

* Women
total  AR_com_m AR_com_m_aj AR_com_m_aj_max  AR_com_m_aj_min if ident_mesa_M==1


* Previously registered nonvoters
* Men
total nv_total if inscrito_antes_de_ley=="SI" & sexo==1
* Women
total nv_total if inscrito_antes_de_ley=="SI"& sexo==0

* Change attributable to voluntary voting among the registered
* Men
total vol_vot_aj vol_vot_aj_min vol_vot_aj_max  if sexo==1
* Women
total vol_vot_aj vol_vot_aj_min vol_vot_aj_max if sexo==0

// Table A4.1 works with another database, so see lines 336

// Figure 4 Changes after reform

// Automatic registration by age
total v_rango1819 v_rango2024 v_rango2529 v_rango3034 v_rango3539 v_rango4044 v_rango4549 v_rango5054 v_rango5559 v_rango6064 v_rango6569 v_rango7074 v_rango7579 v_rango80 if inscrito_antes_de_ley=="NO"

// Automatic registration by sex and age
total sum_m1819 sum_m2024 sum_m2529 sum_m3034 sum_m3539 sum_m4044 sum_m4549 sum_m5054 sum_m5559 sum_m6064 sum_m6569 sum_m7074 sum_m7579 sum_m80  if ident_mesa_M==1
total sum_v1819 sum_v2024 sum_v2529 sum_v3034 sum_v3539 sum_v4044 sum_v4549 sum_v5054 sum_v5559 sum_v6064 sum_v6569 sum_v7074 sum_v7579 sum_v80  if ident_mesa_V==1

* Minimum change by sex and age
total min2_sum_m1819 min2_sum_m2024 min2_sum_m2529 min2_sum_m3034 min2_sum_m3539 min2_sum_m4044 min2_sum_m4549 min2_sum_m5054 min2_sum_m5559 min2_sum_m6064 min2_sum_m6569 min2_sum_m7074 min2_sum_m7579 min2_sum_m80  if ident_mesa_M==1
total min2_sum_v1819 min2_sum_v2024 min2_sum_v2529 min2_sum_v3034 min2_sum_v3539 min2_sum_v4044 min2_sum_v4549 min2_sum_v5054 min2_sum_v5559 min2_sum_v6064 min2_sum_v6569 min2_sum_v7074 min2_sum_v7579 min2_sum_v80  if ident_mesa_V==1

* Maximum change by sex and age	
total max2_sum_m1819 max2_sum_m2024 max2_sum_m2529 max2_sum_m3034 max2_sum_m3539 max2_sum_m4044 max2_sum_m4549 max2_sum_m5054 max2_sum_m5559 max2_sum_m6064 max2_sum_m6569 max2_sum_m7074 max2_sum_m7579 max2_sum_m80  if ident_mesa_M==1
total max2_sum_v1819 max2_sum_v2024 max2_sum_v2529 max2_sum_v3034 max2_sum_v3539 max2_sum_v4044 max2_sum_v4549 max2_sum_v5054 max2_sum_v5559 max2_sum_v6064 max2_sum_v6569 max2_sum_v7074 max2_sum_v7579 max2_sum_v80  if ident_mesa_V==1

// Voluntary voting by age

* gen vol_vot_aj= nv_total-(1-part_com_gen_2009)*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"
* gen vol_vot_aj_min= nv_total-(1-min_part2009)*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"
* gen vol_vot_aj_max= nv_total-(1-max_part2009)*(nv_total+v_total) if  inscrito_antes_de_ley=="SI"

foreach x in 1819 2024 2529 3034 3539 4044 4549 5054 5559 6064 6569 7074 7579 80 {
gen vol_vot_aj`x'= nv_rango`x'-(1-part_com_gen_2009)*(nv_rango`x'+v_rango`x') if  inscrito_antes_de_ley=="SI"
gen vol_vot_aj2_min`x'= nv_rango`x'-(1-max(part_com_gen_2009-sd_part09,0))*(nv_rango`x'+v_rango`x') if  inscrito_antes_de_ley=="SI"
gen vol_vot_aj2_max`x'= nv_rango`x'-(1-min(part_com_gen_2009+sd_part09,1))*(nv_rango`x'+v_rango`x') if  inscrito_antes_de_ley=="SI"
}

* Adjusted change by age
total vol_vot_aj1819 vol_vot_aj2024 vol_vot_aj2529 vol_vot_aj3034 vol_vot_aj3539 ///
	vol_vot_aj4044 vol_vot_aj4549 vol_vot_aj5054 vol_vot_aj5559 vol_vot_aj6064 ///
	vol_vot_aj6569 vol_vot_aj7074 vol_vot_aj7579 vol_vot_aj80
	
* Minimum change by age
total vol_vot_aj2_min1819 vol_vot_aj2_min2024 vol_vot_aj2_min2529 vol_vot_aj2_min3034 ///
	vol_vot_aj2_min3539 vol_vot_aj2_min4044 vol_vot_aj2_min4549 vol_vot_aj2_min5054 ///
	vol_vot_aj2_min5559 vol_vot_aj2_min6064 vol_vot_aj2_min6569 vol_vot_aj2_min7074 ///
	vol_vot_aj2_min7579 vol_vot_aj2_min80

* Maximum change by age	
total vol_vot_aj2_max1819 vol_vot_aj2_max2024 vol_vot_aj2_max2529 vol_vot_aj2_max3034 ///
	vol_vot_aj2_max3539 vol_vot_aj2_max4044 vol_vot_aj2_max4549 vol_vot_aj2_max5054 ///
	vol_vot_aj2_max5559 vol_vot_aj2_max6064 vol_vot_aj2_max6569 vol_vot_aj2_max7074 ///
	vol_vot_aj2_max7579 vol_vot_aj2_max80

// Figure 5 Changes after reform as a fraction of their relevant populations (see Excel file "Figures 4 and 5")

// Appendix: Figure 1 Registration Rate 2005-2009 by County Typology

gen inscritos_periodo=sum_v1819+sum_v80+ sum_v2024+ sum_v2529+ sum_v3034+  sum_v3539+sum_v4044+ sum_v4549+  sum_v5054+ sum_v5559+  sum_v6064+ sum_v6569+sum_v7074+  sum_v7579 + sum_m1819+ sum_m80+  sum_m2024+ sum_m2529+ sum_m3034+  sum_m3539+sum_m4044+ sum_m4549+  sum_m5054+ sum_m5559+  sum_m6064+ sum_m6569+sum_m7074+  sum_m7579
bysort comuna: egen total_padron_com =sum(totalpadron)
gen inscritos_periodo_pc=inscritos_periodo/total_padron_com
twoway (scatter inscritos_periodo_pc tipologia, sort) if ident_mesa_V==1| ident_mesa_M==1, ytitle(Registration rate) xtitle(Typology) xscale(range(0.5 8.5)) xlabel(1(1)8, valuelabel) title(Registration Rate 2005-2009 by Type of Municipality)

// Appendix: Figure 2 2009 Turnout Rate by County Typology

twoway (scatter part_com_gen_2009 tipologia, sort) if ident_mesa_V==1| ident_mesa_M==1, ytitle(Turnout rate) xtitle(Typology) xscale(range(0.5 8.5)) xlabel(1(1)8, valuelabel) title(2009 Turnout Rate by Type of Municipality)





// Code for Table 1
use part_2008_2009.dta, clear
gen dif_08_09=part_com_gen_2009 - part_08 
gen dif_08_09_abs=abs(dif_08_09)
gen dif_sd= dif_08_09_abs/ sd_part09
gen dif_sd_sign= dif_08_09/ sd_part09
gen less_mean_sd=(dif_sd<0.4)
gen less_1_sd=(dif_sd_sign>1)
gen less_1_sd_neg=(dif_sd_sign<-1)
gen less_2_sd=(dif_sd_sign>2)
gen less_2_sd_neg=(dif_sd_sign<-2)

** Table 1 Variation in turnout between 2008 and 2009, at the municipality level 
mean dif_sd 
tab less_mean_sd 
tab less_1_sd 
tab less_1_sd_neg 
tab less_2_sd 
tab less_2_sd_neg 



// Placebo
bysort tipologia: egen min_part2008_w=min(part_women)
bysort tipologia: egen min_part2008_m=min(part_men)
bysort tipologia: egen max_part2008_w=max(part_women)
bysort tipologia: egen max_part2008_m=max(part_men)
gen min_part2008=min_part2008_w if sexo==0
replace min_part2008=min_part2008_m if sexo==1
gen max_part2008=max_part2008_w if sexo==0
replace max_part2008=max_part2008_m if sexo==1
gen part_com_gen_08=part_women if sexo==0
replace part_com_gen_08=part_men if sexo==1

gen vol_vot_placebo= ((1-part_com_gen_2009)-(1-part_com_gen_08))*regs_com_gen2009
 
bysort tipologia: egen sd_part08w=sd(part_women)
bysort tipologia: egen sd_part08m=sd(part_men)
gen sd_part08=sd_part08w if sexo==0
replace sd_part08=sd_part08m if sexo==1

//1 SD
// note that turnout should be in [0,1]
gen vol_vot_placebo_min= ( (1-part_com_gen_2009)-(1-max(0,part_08-sd_part08)))*regs_com_gen2009 
gen vol_vot_placebo_max= ((1-part_com_gen_2009)-(1-min(1,part_08+sd_part08)))*regs_com_gen2009
//2 SD
gen vol_vot_placebo_min2= ((1-part_com_gen_2009)-(1-max(0,part_08-2*sd_part08)))*regs_com_gen2009
gen vol_vot_placebo_max2= ((1-part_com_gen_2009)-(1-min(1,part_08+2*sd_part08)))*regs_com_gen2009


// Table A4.1 Placebo Test: Changes in 2009 Compared to 2008 
total vol_vot_placebo vol_vot_placebo_min vol_vot_placebo_max vol_vot_placebo_min2 vol_vot_placebo_max2

